home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / tphers01.zip / TSTHERSH.PAS < prev   
Pascal/Delphi Source File  |  1991-09-08  |  4KB  |  99 lines

  1. {*****************************************************************************}
  2. {*  TSTHERSH.PAS                                                             *}
  3. {*                                                                           *}
  4. {*  An example of how to use the TPHERSH unit.                               *}
  5. {*                                                                           *}
  6. {*  Dov Grobgeld                                                             *}
  7. {*  Department of Chemical Physics                                           *}
  8. {*  The Weizmann Institute of Science                                        *}
  9. {*  Israel                                                                   *}
  10. {*  Email: dov@menora.weizmann.ac.il                                         *}
  11. {*                                                                           *}
  12. {*  8/9/1991                                                                 *}
  13. {*                                                                           *}
  14. {*****************************************************************************}
  15.  
  16. uses graph, dos, tphersh;
  17.  
  18. { Include some fonts ... }
  19.  
  20. {$i gothgbt.inc }  { Has to be constructed by the hmp2inc.pl program }
  21. {$i romanc.inc  }  { See the documentation file hmp2inc.doc }
  22. {$i romanp.inc }
  23. {$i cyrilc.inc }
  24. {$i greekc.inc }
  25. {$I italicc.inc }
  26.  
  27. var
  28.   gd, gm,i : integer;
  29.   mem : longint;
  30.  
  31. begin
  32.   mem:= MaxAvail;
  33.   HersheyLoadGlyphs;
  34.   writeln('Font load size: ', mem - MaxAvail);
  35.   write('Press Enter to continue...'); readln;
  36.  
  37.   gd:= detect;
  38.   initgraph(gd, gm, getenv('bgidir')); { Set the environment variable bgi dir }
  39.                                        { to the directory where the bgi files reside }
  40.  
  41.   
  42.   HersheySetFont(HersheyGothgbt);
  43.   HersheySetGlyphSize(60,60);
  44.   HersheySetAngle(-30);
  45.   setcolor(lightred);  { BGI stuff }
  46.   HersheyOutTextXY(50,50, 'TP Hersh');
  47.   HersheySetFont(HersheyItalicC);
  48.   HersheySetGlyphSize(22,14);
  49.   setcolor(yellow);
  50.   HersheyOutTextXY(150,200, 'by Dov Grobgeld');
  51.   setcolor(lightgreen);
  52.   HersheySetAngle(0);
  53.   HersheySetGlyphSize(10,10);
  54.   HersheySetFont(HersheyRomanC);
  55.   HersheyOutTextXY(150,20, '!"#$%&''()*+,-./09:;<=>?@A{\}~'#127);
  56.   HersheySetFont(HersheyCyrilc);
  57.   HersheyOutTextXY(200,70, 'Cyrillic');
  58.   HersheySetFont(HersheyGreekC);
  59.   HersheyOutText(' and Greek.');
  60.  
  61.   HersheySetFont(HersheyRomanC);
  62.   HersheyMove(450,170);
  63.   setcolor(lightCyan);
  64.   HersheySetGlyphSize(20,20);
  65.   HersheySetAngle(45);
  66.   for i:= 1 to 7 do HersheyDisplayGlyph(740 + i);
  67.   setColor(lightGreen);
  68.   HersheyMove(600,80);
  69.   HersheySetAngle(-100);
  70.   HersheySetGlyphSize(30,30);
  71.   for i:= 1 to 10 do HersheyDisplayGlyph(840+i);
  72.   HersheySetGlyphSize(12,12);
  73.   HersheySetAngle(0);
  74.   HersheySetStringJustify(-1,0); HersheyOutTextXY(50, 170, 'abc');
  75.   HersheySetStringJustify(0,0); HersheyOutTextXY(50, 200, 'abc');
  76.   HersheySetStringJustify(1,0); HersheyOutTextXY(50, 230, 'abc');
  77.   HersheySetStringJustify(-1,-1); HersheyOutTextXY(80, 230, 'A');
  78.   HersheySetStringJustify(-1,0); HersheyOutText('A');
  79.   HersheySetStringJustify(-1,1); HersheyOutText('A');
  80.   HersheySetStringJustify(1,0);
  81.   HersheySetFont(HersheyRomanP);
  82.   HersheySetStringJustify(0,0);
  83.   HersheyOutTextXY(100,300, 'Some centered strings');
  84.   HersheyOutTextXY(100,320, '12345');
  85.   HersheyOutTextXY(100,330, '941');
  86.  
  87.   HersheySetGlyphSize(8,8);
  88.   HersheySetFont(HersheyRomanC);
  89.   HersheySetStringJustify(-1,0);
  90.   HersheySetGlyphSize(6,6);
  91.   HersheyMove(210,320); HersheyDisplayGlyph(2269);
  92.   HersheySetGlyphSize(8,8);
  93.   HersheyOutText('E=0');
  94.  
  95.  
  96.   readln;
  97.   closegraph;
  98. end.
  99.